import 'package:flustars_flutter3/flustars_flutter3.dart';
import 'package:flutter/material.dart';
import 'package:ls_work/a_mine/models/mine_entity.dart';
import 'package:ls_work/res/styles.dart';
import 'package:ls_work/widgets/load_image.dart';
import 'package:base_flutter/base_flutter.dart';

class MeTopView extends StatelessWidget {
  final MineBaseInfo? info;
  MeTopView({Key? key, this.info});

  @override
  Widget build(BuildContext context) {
    String userName = info?.name ?? '';
    String mainPostName = info?.mainPostName ?? '';
    String serviceAreaNames = info?.serviceAreaNames ?? '';
    String groupNames = info?.groupNames ?? '';
    return Container(
      padding: EdgeInsets.all(20),
      width: ScreenUtil.getScreenW(context),
      constraints: BoxConstraints(minHeight: 110),
      child: Row(
        mainAxisAlignment: MainAxisAlignment.start,
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          // LoadImage(iconUrl,width: 70,height: 70,),
          LoadAssetImage('mine/me_icon'),
          SizedBox(
            width: 15,
          ),
          Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            children: <Widget>[
              Text.rich(TextSpan(children: [
                TextSpan(text: "$userName",style: TextStyles.textBoldDark14,),
                TextSpan(
                    text: "   $mainPostName",
                    style: TextStyles.textGray12,),
              ])),
              // Text(
              //   '$userName  $mainPostName',
              //   style: TextStyles.textBoldDark14,
              // ),
              Text(
                '$serviceAreaNames  $groupNames',
                style: TextStyles.textGray14,
              )
            ],
          ).setWeight(1)
        ],
      ),
    );
  }
}
